<!-- 系统管理员管理端统计页面 -->
<template>
  <div class="">
    <div>
      <div id="cardArea">
        <el-card id="totalCount" class="box-card">
          <div class="info-label"><b>上课总时长</b></div>
          <div class="info-label2">
            <svg-icon icon-class="user" class="icon" class-name="card-panel-icon" style="color:#409EFF;font-size:50px;float:left" />
            <span id="totalUser-num" class="num">{{ info.attendClassTimeNumber }}<span style="font-size:15px">时</span></span>
          </div>
        </el-card>

        <el-card id="contactCount" class="box-card">
          <div class="info-label"><b>上课节数</b></div>
          <div class="info-label2" style="color:#67C23A  ">
            <svg-icon icon-class="table" class="icon" class-name="card-panel-icon" style="font-size:50px;float:left" />
            <span id="contactUser-num" class="num">{{ info.attendClassNumber }}<span style="font-size:15px">节</span></span>
          </div>
        </el-card>
      </div>
      <div id="cardArea">
        <el-card id="feverCount" class="box-card">
          <div class="info-label"><b>学生人数</b></div>
          <div class="info-label2" style="color:#F56C6C">
            <svg-icon icon-class="user" class="icon" class-name="card-panel-icon" style="font-size:50px;float:left" />
            <span id="feverUser-num" class="num">{{ info.studentNumber }}<span style="font-size:15px">人</span>  </span>
          </div>
        </el-card>

        <el-card id="feverCount" class="box-card">
          <div class="info-label"><b>课程数量</b></div>
          <div class="info-label2" style="color:#F56C6C">
            <svg-icon icon-class="table" class="icon" class-name="card-panel-icon" style="font-size:50px;float:left" />
            <span id="feverUser-num" class="num">{{ info.clazzNumber }}<span style="font-size:15px">门</span>  </span>
          </div>
        </el-card>
      </div>
    </div>
  </div>
</template>

<script>
// 这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
// 例如：import 《组件名称》 from '《组件路径》';
import { GetInfo } from '@/api/work'
import store from '@/store/index'
export default {
  name: 'AdminStatistic',
  // import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // 这里存放数据
    return {
      info: {},
      currentPage: 1, // 默认显示页面为1
      pagesize: 5, //    每页的数据条数
      list: [],
      BB: store.getters.userId,
      activeName: 'first',
      search: {
        // unit: '',
        // date: '',
        // type: '',
        id: '',
        minAge: '',
        maxAge: '',
        minPrice: '',
        maxPrice: ''
        // payType: ''
      },
      select: {},
      listLoading: false,
      dialogFormVisible: false,
      order: {},
      visible: false,
      org: [],
      lType: '',
      campuslist: [],
      x_chart: [],
      nameList: [],
      chartlist: [],
      searchdate: '',
      allMoney: 0,
      rules: {
        date: [
          { required: true, message: '请选择日期', trigger: 'blur' }
        ],
        unit: [
          { required: true, message: '请选择统计方式', trigger: 'blur' }
        ],
        minAge: [
          { validator: this.validateCom, trigger: 'blur' },
          { validator: this.validateMin, trigger: 'blur' }
        ],
        maxAge: [
          { validator: this.validateCom, trigger: 'blur' },
          { validator: this.validateMax, trigger: 'blur' }
        ],
        minPrice: [
          { validator: this.validateComPrice, trigger: 'blur' },
          { validator: this.validateMinPrice, trigger: 'blur' }
        ],
        maxPrice: [
          { validator: this.validateComPrice, trigger: 'blur' },
          { validator: this.validateMaxPrice, trigger: 'blur' }
        ]
      }
    }
  },
  // 监听属性 类似于data概念
  computed: {},
  // 监控data中的数据变化
  watch: {},
  // 生命周期 - 创建完成（可以访问当前this实例）
  created() {
    this.fetchData()
  },
  // 生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {

  },
  beforeCreate() {}, // 生命周期 - 创建之前
  beforeMount() {}, // 生命周期 - 挂载之前
  beforeUpdate() {}, // 生命周期 - 更新之前
  updated() {}, // 生命周期 - 更新之后
  beforeDestroy() {}, // 生命周期 - 销毁之前
  destroyed() {}, // 生命周期 - 销毁完成
  activated() {},
  // 方法集合；【=【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【【‘

  methods: {

    fetchData() {
      GetInfo(Number(this.BB)).then((resp) => {
        console.log('BB的值', this.BB)
        console.log(resp)
        this.info = resp.obj
      }).catch((err) => {
        console.log(err)
      })
    }

  } // 如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style  scoped>

#cardArea{
    margin: 50px;
    display: flex;
    justify-content: center;

}

 .box-card {
    margin-left: 30px;
    width: 400px;
    height: 180px;
  }

 .info-label{
    line-height: 50px;
    margin-top: 0px;
  }

  .info-label2{
    line-height: 100px;
    margin-top: 0px;
  }

  #totalUser-num{
  color: #409EFF;
  /* font-size: 35px; */
}

.info-label
{
  color: #606266;
  /* text-align: right; */
  /* font-size:35px; */
}

.num{
  float:right;
  text-align: right;
  font-size: 35px;
  margin-right: 10px;
  /* margin-left: 60%; */
}

.icon{
  margin-top: 15px;
  text-align: left;
}
.tab{
  margin: 0 auto;
  width: 1400px;
}
.pie{
   margin: 50px auto;
   width: 1400px;
}
#myPie1{
  width: 1300px;
  height: 540px;
}
#table-area{
  margin-left: 10px;
  margin-right: 10px;
}
#search-card {
  margin-left: 50px;
  margin-top: 30px;
  width: 100%;
  height: 70px;
  overflow-x: hidden;
}
.orders-card{
  width: 1400px;
  margin: 50px auto;
}
.search-chart{
  width: 1400px;
  margin: 0 auto;
  /* margin-left: 50px; */
}
.search-form{
  width: 98%;
  margin: 0 auto;
}
.orders-title{
  color: #606266;
  font-size: 24px;
  margin-bottom: 20px;

}
.download{
  float: right;
  margin-bottom: 15px;
  margin-right: 40px;
}
</style>
